package oop.java0321;

import java.util.Scanner;

public class CompanyTest {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        Company company = new Company();
        company.name = "远方娱乐责任有限公司";
        company.address = "上海浦东新区";
        company.telePhone = "7417417474741";
        company.scope = "吃喝玩乐一条龙";

        while (true) {
            System.out.println("-----------------------------------");
            System.out.print("1.查看公司信息\n2.招聘员工\n3.查看全部员工信息\n4.查看指定员工信息\n5.辞退员工\n请选择：(输入0退出)");
            int no = in.nextInt();
            System.out.println();
            switch (no) {
                case 1: {
                    company.showCompanyInfo();
                    break;
                }
                case 2: {
                    company.addEmployee();
                    break;
                }
                case 3: {
                    company.showAllInfo();
                    break;
                }
                case 4: {
                    System.out.print("请输入查找序号：");
                    int number4 = in.nextInt();
                    company.showIndexInfo(number4);
                    break;
                }
                case 5: {
                    System.out.print("请输入要辞退的员工姓名：");
                    String name5 = in.next();
                    company.dissmissEmployee(name5);
                    break;
                }
                default: {
                    System.out.println("无效序号！");
                }
            }
            if (no == 0) {
                System.out.println("退出！");
                return;
            }
        }
    }
}
